package com.easybbs.entity.enums;

public enum VerifyRegexEnum {
    NO("", "不校验"),
    IP("^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3})$", "IP地址"),
    POSITIVE_INTEGER("^((0{1}.\\d{1,2})|([1-9]\\d.{1}\\d{1,2})|([1-9]+\\d)|0)$", "正整数"),
    NUMBER_LETTER_UNDER_LINE("^\\w+$", "由数字、26个英文字母或下划线组成的字符串"),
    EMAIL("^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$", "邮箱"),
    PHONE("^1[3-9]\\d{9}$", "手机号码"),
    COMMON("^[\\u4e00-\\u9fff\\w_]+$", "数字，字母，中文，下划线"),
    PASSWORD("^(?=.*[a-zA-Z])(?=.*\\d)[a-zA-Z\\d!@#$%^&*()_+-]{8,18}$", "包含数字和字母允许特殊字符，长度在 8 - 18 位"),
    ACCOUNT("^[0-9a-zA-Z_]{1,}$", "字母开头，由数字、英文字母或者下划线组成"),
    MONEY("^([1-9]\\d{0,9}|0)([.]?|(\\.\\d{1,2})?)$", "金额");

    private String regex;
    private String desc;

    VerifyRegexEnum(String regex, String desc) {
        this.regex = regex;
        this.desc = desc;
    }

    public String getRegex() {
        return regex;
    }

    public String getDesc() {
        return desc;
    }
}
